// 写一个基于typeScript设计模式的原型模式
const Prototype = function (name) {
    this.name = name;
};

Prototype.prototype = {
    constructor: Prototype,

    getName: function () {
        return this.name;
    },

    clone: function () {
        return new this.constructor(this.name);
    }
};

const prototype = new Prototype('prototype');
const clone = prototype.clone();

console.log(prototype.name); // prototype
console.log(clone.name); // prototype